﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DHAA.Areas.Administrator.Models.AdminModels>" %>
<div style="width: 640px">
    <% using (Ajax.BeginForm("Create", new AjaxOptions { UpdateTargetId = "fancybox-content", LoadingElementId = "loadingIcon", OnBegin = "MvcFormOnBegin", OnSuccess = "MvcFormOnSuccess", OnComplete = "MvcFormOnComplete", OnFailure = "MvcFormOnFailure" }))
       {%>
    <%= Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Create new Admin</legend>
        <div class="Message Error"><%= ViewData["MessageError"] %></div>
        <div class="Message Success"><%= ViewData["MessageSuccess"] %></div>
        <div class="display-label">
            <%= Html.LabelFor(model => model.Username) %>
        </div>
        <div class="editor-field">
            <%= Html.TextBoxFor(model => model.Username) %>
         <%= Html.ValidationMessageFor(model => model.Username) %>  
        </div>
        <div class="display-label">
            <%= Html.LabelFor(model => model.NewPassword) %>
        </div>
        <div class="editor-field">
            <%= Html.TextBoxFor(model => model.NewPassword) %>
            <%= Html.ValidationMessageFor(model => model.NewPassword) %>
        </div>
        <div class="display-label">
            <%= Html.LabelFor(model => model.ConfirmPassword) %>
        </div>
        <div class="editor-field">
            <%= Html.TextBoxFor(model => model.ConfirmPassword) %>
            <%= Html.ValidationMessageFor(model => model.ConfirmPassword) %>
        </div>  
        <div class="display-label">
            <%= Html.LabelFor(model => model.AdminName) %>
        </div>
        <div class="editor-field">
            <%= Html.TextBoxFor(model => model.AdminName) %>
           <%= Html.ValidationMessageFor(model => model.AdminName) %>
        </div>
        <div>
            <input type="submit" value="Create" /><div id="loadingIcon" ></div> <input type="button" value="Cancel" onclick="$.fancybox.close()"/>
       </div>
    </fieldset>
    <% } %>
</div>
